import request from '@/utils/request'
/**
 * 字典
 **/
// 获取字典树形结构
export const getDictTree = params => request('/api/v1/SystemDict/GetDictTree', { params: params });
// 获取字典列表
export const getDictList = params => request('/api/v1/SystemDict/GetListNoPage', { params: params });

export const getList = params => request('/api/v1/SystemDict/GetList', { params: params });
export const dictCreate = data => request.post('/api/v1/SystemDict/Create', data);

// 更新字典
export const dicttUpdate = data => request.post('/api/v1/SystemDict/Update', data);

// 获取字典信息
export const dictInfo = params => request('/api/v1/SystemDict/Get', { params: params });

// 删除字典
export const dictDelete = data => request.delete('/api/v1/SystemDict/Delete', { data: data });

// 根据配置key查询
export function getConfigByKey(dataKey, type) {
  return request({
    url: '/api/v1/SystemDict/GetConfigByKey',
    method: 'get',
    params: { "configKey": dataKey, "type": type }
  })
}
export function getFirstSubConfigByKey(dataKey) {
  return request({
    url: '/api/v1/SystemDict/GetFirstSubConfigByKey',
    method: 'get',
    params: { "configKey": dataKey }
  })
}
